<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/WEB-INF/tld/ce.tld" prefix="ce" %>

<%
    /*
      2015年11月17日10:42:31
     * 输入税号时候-入库
     * 周露
     * */
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/cases/source/";  //应用的地址名
    //String modifyActionName = path+request.getAttribute("REQUEST_PATH")+"?op=savejs";
    String modifyActionName = "http://localhost:10087/ntax/cases/source/CaseSourceDrawApprove_add.action?op=savejs";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

    <title>http://localhost:10087/ntax/cases/source/CaseSourceDrawApprove_add.action?op=savejs--</title>
    <script language="javascript" src="<%=path %>/jslib/orgSelect.js"></script>
    <script type="text/javascript">
        <!--
        $(function(){

           /* 测试取值
           alert("basepath="+$("#basepath").val());
           */
            $('#involvedEnterprice').validatebox({
                required:'true',
                missingMessage:'请输入企业名称',
                validType:'length[1,40]'
            });
            $('#taxpayerNumber').validatebox({
                required:'true',
                missingMessage:'请输入纳税人识别号',
                validType:'length[1,20]'
            });

            $('#caseFromNum').validatebox({
                required:'true',
                missingMessage:'请选择案件来源',
                validType:'length[1,20]'
            });

            $('#drawReason').validatebox({
                required:'true',
                missingMessage:'基本情况及提请（移送）理由不能为空！',
                validType:'length[1,500]'
            });



            $('#illegalTypeNum').validatebox({
                required:'true',
                missingMessage:'请选择涉嫌违法类型',
                validType:'length[1,20]'
            });


            $('#inspectionDeptId').combobox({
                url:'<%=path %>/util/util_getInspectionList.action?id=15009070000',
                valueField:'id',
                textField:'text',
                editable:false,
                onChange: function(n,o){
                    var url = '<%=path %>/util/util_getInspectionList.action?id='+n;
                    $('#collectionDeptId').combobox('reload', url);
                }
            });

            $('#collectionDeptId').combobox({
                url:'<%=path %>/util/util_getInspectionList.action?id='+$('#inspectionDeptId').val(),
                valueField:'id',
                textField:'text',
                editable:false
            });
            if($('#inspectionDeptId').val()){
                $('#inspectionDeptId').combobox('setValue',$('#inspectionDeptId').val());
                $('#inspectionDeptId').change();
            }
            if($('#collectionDeptId').val()){
                $('#collectionDeptId').combobox('setValue',$('#collectionDeptId').val());
            }

            /*
                      2015年11月17日10:42:31
                     * 输入税号时候-同步清分库数据
                     * 周露
                     * */
            $('#taxpayerNumber').change(
                                        function(){
                                                    if($('#taxpayerNumber').val())
                                                    {
                                                        $.post(
                                                                "<%=path%>/util/util_getNsrinfoByTaxpayerNumber.action?taxpayerNumber="+$('#taxpayerNumber').val(),
                                                                function(data)
                                                                {
                                                                    jsonReStr = jQuery.parseJSON(data);
                                                                    if(jsonReStr.opState=="failure")
                                                                    {  //操作失败处理
                                                                        $('#inspectionDeptId').combobox('setValue','');
                                                                        $('#collectionDeptId').combobox('setValue','');
                                                                        $('#involvedEnterprice').val('');
                                                                        $('#inspectionDept').val('');
                                                                        $('#collectionDept').val('');
                                                                        $.messager.alert('消息提示','操作处理失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
                                                                        // $('#taxpayerNumber').val('');
                                                                        //return ;
                                                                    }
                                                                    else
                                                                    {
                                                                        $('#inspectionDeptId').combobox('setValue',jsonReStr.jcjdm);
                                                                        $('#inspectionDept').val(jsonReStr.jcjmc);

                                                                        $('#involvedEnterprice').val(jsonReStr.nsrmc);
                                                                        $('#caseNumber').val(jsonReStr.statusInfo);
                                                                        //$('#inspectionDeptId').change();
                                                                        $('#collectionDeptId').combobox('setValue',jsonReStr.zgswjDm);
                                                                        $('#collectionDept').val(jsonReStr.zgswjMc);
                                                                    }

                                                                }
                                                        );
                                                    }

                                                }
                                        );
            //点击添加按钮操作
            $('#addBtn').click(function(){
                $('#caseFromName').val($('#caseFromNum option:selected').text());
                $('#illegalTypeName').val($('#illegalTypeNum option:selected').text());
                $('#editForm').submit();
            });
            //表单验证及提交处理操作
            $('#editForm').form({
                url:'<%=modifyActionName%>',
                onSubmit: function(){
                    if($(this).form('validate')){
                        $.util.showLoading();
                        $('#operateWindow').window('close');
                        return true;
                    }else{
                        return false;
                    }
                },
                success:function(data){
                    $.util.removeLoading();
                    returnOptMsg(data);
                }
            });

            $('#fileTr').css('display',$('#fileTd').html()!=''?"":"none");
            $('#uploadFile').click(function(){
                if($('#uploadFile').css('color')=='gray')
                    return;
                fileupload('fileId',null,'fileTd','approve',{param:{urlSplit:'&nbsp;'}},function(){
                    $('#fileTr').css('display',$('#fileTd').html()!=''?"":"none");
                });
            });

        });
        //-->
    </script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<s:form action="editForm" method="post">
    <input type="hidden" id="basepath" value=<%=modifyActionName%>>
    <s:hidden name="po.vcId"/>
    <s:hidden id="fileId" name="po.fileId"/>
    <s:hidden id="caseFromName" name="po.caseFromName"/>
    <s:hidden id="illegalTypeName" name="po.illegalTypeName"/>
    <s:hidden id="inspectionDept" name="po.inspectionDept"/>
    <s:hidden id="collectionDept" name="po.collectionDept"/>

    <table align="center" class="tb_add_th" width="100%">
        <tr><th>纳税人识别号:</th><td><s:textfield id="taxpayerNumber"  name="po.taxpayerNumber" /></td>
            <th>涉案企业:</th><td><s:textfield id="involvedEnterprice"  name="po.involvedEnterprice" /></td>
        </tr>

        <tr><th>管辖稽查局:</th><td><s:textfield id="inspectionDeptId"  name="po.inspectionDeptId" />
        </td>
            <th>所属征管局:</th><td><s:textfield id="collectionDeptId"  name="po.collectionDeptId" /></td>
        </tr>
        <tr><th>是否重点税源:</th><td><s:radio name="po.isImportant" list="#{1:'是',0:'否'}"/></td>
            <th>是否保密税源:</th><td><s:radio name="po.isSecret" list="#{1:'是',0:'否'}"/></td>
        </tr>
        <tr></tr>
        <tr><th>案件来源:</th><td><ce:dictSelect id="caseFromNum" name="po.caseFromNum" dictName="提请案源台账-案件来源" blankOption="true"/></td>
            <th>涉嫌违法类型:</th><td><ce:dictSelect id="illegalTypeNum" name="po.illegalTypeNum" dictName="备选案源台账-涉嫌违法类型" blankOption="true"/></td>
        </tr>
        <tr><th style="text-align:center">基本情况及提请（移送）理由:</th><td colspan="3"><s:textarea id="drawReason"  name="po.drawReason" rows="4" cols="50" style="width:425px;height:50px;"/></td></tr>

        <tr><th>登记人:</th><td><s:textfield id="registerPerson"  name="po.registerPerson" label="登记人" /></td>
            <th>登记日期:</th><td><input type="text" id="registerDate"  name="po.registerDate" value="<s:date name="po.registerDate" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" readonly="true" /></td>
        </tr>
        <tr><th align="left">电子材料：</th><td colspan=3><a id="uploadFile" href="javascript:void(0)">点击上传电子材料</a></td></tr>
        <tr id="fileTr" colspan=4><td id="fileTd" colspan="4">
            <s:property value="po.fileHtml" escape="false"/>
        </td>
        </tr>

    </table>
</s:form>
</body>
</html>



<%--

http://localhost:10087/ntax/cases/source/CaseSourceDrawApprove_add.action?op=savejs





po.vcId:
po.fileId:
po.caseFromName:专项整治
po.illegalTypeName:偷税
po.inspectionDept:
po.collectionDept:
po.collectionDept:
po.taxpayerNumber:500242198804016036
po.involvedEnterprice:有限公司
po.inspectionDeptId:15007010000
po.collectionDeptId:15001090000
po.isImportant:1
po.isSecret:1
po.caseFromNum:1
po.illegalTypeNum:1
po.drawReason:dafaf
po.registerPerson:超级管理员
po.registerDate:2015-11-17

--%>
